package com.android.jogomemoria;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ViewFlipper;

public class Turismo extends Activity implements Runnable{

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.turismo);

        final ViewFlipper flip = (ViewFlipper) findViewById(R.id.flip);

        //Utiliza algumas anima��es padr�o do Android
        Animation in = AnimationUtils.loadAnimation(this, android.R.anim.fade_in);
        in.setDuration(3000);

        Animation out = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right);
        out.setDuration(2000);

        flip.setInAnimation(in);
        flip.setOutAnimation(out);
        
        //Carrega a pr�xima View
        Button bProximo = (Button) findViewById(R.id.btnProximo);
        bProximo.setOnClickListener(new OnClickListener(){
        	public void onClick(View v) {
                flip.showNext();
            }});

        //Carrega a view anterior
        Button bAnterior = (Button) findViewById(R.id.btnAnterior);
        bAnterior.setOnClickListener(new OnClickListener(){
            
            public void onClick(View v) {
                flip.showPrevious();
            }});
    }

	public void run() {
		// TODO Auto-generated method stub
		finish();
	}
}
